package ch13.client;

import ch13.server.RemoteSubject;

import java.rmi.Naming;
import java.rmi.Remote;
public class ClientApplication{
    public static void main(String args[]){
        try{
            Remote  remoteObject=Naming.lookup("rmi://127.0.0.1/rect");
            RemoteSubject remoteSubject= (RemoteSubject)remoteObject;
            remoteSubject.setWidth(129);
            remoteSubject.setHeight(528);
            double area=remoteSubject.getArea();
            System.out.println("面积:"+area);
        }
        catch(Exception exp){
            System.out.println(exp.toString());
        }
    }
}
